Option Strict Off
Option Explicit On
Namespace BMLERP
	Friend Class frmINV200
		Inherits System.Windows.Forms.Form
		Dim ReportName As String
		Private Sub cmdExit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdExit.Click
			Me.Close()
		End Sub

		Private Sub cmdPrint_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdPrint.Click
			'Dim bdate, edate As Date
			CrystalReport1.ReportFileName = DDAN & "\" & ReportName
			If OptReport(0).Checked = True Then
				Dim myform As New FrmReportDateRange
				myform.Show()
				'FrmReportDateRange/.ShowDialog()
				If Reportflg = False Then
					Exit Sub
				End If
				'    Dim Objcmd As Command
				'    Set Objcmd = New ADODB.Command
				'    Objcmd.CommandText = "UPDATEONORDER"
				'    Objcmd.CommandType = adCmdStoredProc
				'     Set Objcmd.ActiveConnection = DBconn
				'    Objcmd.Execute

				CrystalReport1.RetrieveStoredProcParams()
				CrystalReport1.set_StoredProcParam(0, VB6.Format(FrmReportDateRange.bdate.Text, "mm/dd/yy"))
				CrystalReport1.set_StoredProcParam(1, VB6.Format(FrmReportDateRange.edate.Text, "mm/dd/yy"))
				CrystalReport1.Action = 1
				FrmReportDateRange.Close()
			Else
				CrystalReport1.RetrieveStoredProcParams()
				CrystalReport1.Destination = Crystal.DestinationConstants.crptToWindow
				CrystalReport1.Action = 1
			End If

		End Sub



		Private Sub OptReport_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles OptReport.CheckedChanged
			If eventSender.Checked Then
				Dim Index As Short = OptReport.GetIndex(eventSender)
				Select Case Index
					Case 0
						ReportName = "INV200new.rpt"
					Case 1
						ReportName = "INV220.rpt"
					Case 2
						ReportName = "INV230.rpt"
					Case 3
						ABCReport()
						ReportName = "INV240.rpt"
					Case 4
						ReportName = "INV250.rpt"
					Case 5
						ReportName = "INV260.rpt"

				End Select
			End If
		End Sub
	End Class
End Namespace